package com.net.oil.product.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.product.bean.ProductListBean;
import com.net.oil.product.contract.ProductListContract;
import com.net.oil.product.model.ProductListModel;

/**
 * 作者：lch
 * 时间：2018/4/5:14:39
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class ProductListPresenter extends BasePresenter<ProductListContract.View> implements ProductListContract.Presenter {

    private ProductListContract.View view;
    private ProductListContract.Model model;

    public ProductListPresenter(ProductListContract.View view) {
        this.view = view;
        model = new ProductListModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getProductList(int categoryId, String name, int page, int rows) {
        model.getProductList(categoryId, name, page, rows);
    }

    @Override
    public void getProductListSuccess(ProductListBean productListBeen) {
        view.getProductListSuccess(productListBeen);
    }

    @Override
    public void getProductListFailed() {
        view.getProductListFailed();
    }
}
